<template>
  <div>
    <div class="check">
      <div @click="showbox">
		<image
		    class="imgstyleLogo"
		    :style="{ width: '20px', height: '20px' }"
		    :src= chooseItem.imgSrc
		  />
        <span v-model="chooseItem.name" class="spanstyle">{{chooseItem.name}}</span>
      </div>
      <div v-show="fold" class="dropbox">
        <span
          @click="check(item)"
          v-for="(item, index) in select"
          :key="index"
          class="select"
          >{{ item.name }}</span>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props:['select'],
  data() {
    return {
      chooseItem:{ name: "币安",exchangeType: 2,imgSrc: "../../static/img/ind1.png"},
      fold: false,
      border: true,
      size: 18,
    };
  },
  methods: {
    showbox() {
      this.fold = !this.fold;
    },
    check(item) {
        this.chooseItem=item;
        this.fold = !this.fold;
        this.$emit('selectbox',item)
    },
  },
};
</script>
<style scoped>
.check {
  width: 70px;
  height: 20px;
  font-size: 12px;
  padding: 1px 5px 6px 1px;
  text-align: center;
  border: 1px solid #d9d9d9;
  border-radius: 50px;
}
.imgstyle {
  position: relative;
  top: 5px;
}
.imgstyleLogo {
  position: relative;
  top: 3px;
}
.dropbox {
  position: relative;
  top: 6px;
  height: 75px;
  border: 1px solid #cfcfcf;
  border-radius: 0 0 5px 5px;
  background-color: #ffffff;
  overflow-y: scroll;
}
.select {
  display: block;
  width: 100%;
  height: 25px;
  line-height: 25px;
}
.spanstyle{
    color: #515151;
    width: 25px;
	position: relative;
	top: -3px;
}
</style>